$(document).ready(function(){
    $(".common_errors_container").css({'width': (($(".form_container").outerWidth() - 2) + "px")});

    if ( $.trim( $(".error_message_container").html() ) == "" )
    {
        $(".error_message_container").html("<div class='global_error_field'></div>");
        $(".error_message_container .global_error_field").hide();
    }

    jQuery.validator.messages.equalTo = Messages.Admin.NameRequired;

    var validateParams = {
        rules:
        {
            name: "required",
            language: "required"
        },
        
        messages:
        {
            name:      "<strong>Name: </strong>" + Messages.Admin.NameRequired,
            language:  "<strong>Language: </strong>" + Messages.Admin.LanguageRequired
        },
        submitHandler: function(form) {
            form.submit();
        }
    };
    var adminCreateArticleFormValidatorSettings = generateSettings( validateParams );
    $('#article_form_info').submit(function(){
        $(this).unbind()
               .validate( adminCreateArticleFormValidatorSettings );
        return $(this).valid();
    });
});